var windowName = "userSetGrade";
apiready = function(){
    onWindowShow(function () {
    })
    onWindowHide(function () {
    })
    console.log("index page is OK");
    var PicUpUserHead = new PicUp()
    var Page = createVM("#Page",{
        //页面数据
        grade:[]
        ,curGrade:""
    },{
        //页面方法
        "init":function () {
            var myGrade = getLocData("myGrade")
            Page.gradeId = myGrade.id
            Page.gradeName = myGrade.name
            this.grade = getLocData("grade")
            // var gradeId = getLocData("myGrade")
            Page.curGrade = myGrade.id;
            getInfo(this);
        }
        ,"setGrade":function(gradeId,gradeName) {
            log(gradeId)
            log(gradeName)
            Page.curGrade = gradeId;
            setLocData("myGrade",{id:gradeId,name:gradeName})
            // setLocData("myGradeName",gradeName)
            var login = getLocData("login")
            if (isTrue(login)) {
                apiPost("/app/user/info",{grade:gradeId},function (res) {
                    logJson(res)
                    showToast(res.message)
                    setLocData('userInfo',res.d.user)
                })
            }
        },
    })
    Page.init()
}


function getInfo(_this) {

}